package com.power.sifa.approve.dao.impl;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
import com.power.sifa.approve.dao.Apl_dossierDaoCustom;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
* 电子卷宗 持久层实现(hibernate)
*/

@Repository
public class Apl_dossierDaoImpl implements Apl_dossierDaoCustom{

    @Resource
    private JdbcTemplate jdbcTemplate;

    @Override
    public List<Map<String, Object>> querySpecialMaterial(String applyid) {
        String sql = "select id, 'apl_agent'  as pretype, filecard, doccard, fileentrust, applicantname from apl_agent where applyid = ? " +
                "union select id, 'apl_applicant'  as pretype, filecard, doccard, null, null from apl_applicant where applyid = ? " +
                "union select id, 'apl_thirdper'  as pretype, filecard, doccard, null, null  from apl_thirdper where applyid = ?";

        return jdbcTemplate.queryForList(sql, new Object[]{applyid, applyid, applyid});
    }
}
